import Vue from 'vue'
import App from './App'
import eLoading from './components/loading/index'
import * as func from "@/utils/func.js"
import helper from './helper/helper.js';
//消息弹窗
import uniPopup from './components/uni-popup/uni-popup'
import uniPopupMessage from './components/uni-popup/uni-popup-message'
import uniPopupDialog from './components/uni-popup/uni-popup-dialog'
//加载更多
import uniLoadMore from "./components/uni-load-more/uni-load-more"

Vue.prototype.hspId = 23840 // 全局医院ID
Vue.prototype.func = func
Vue.prototype.noReadNum = 0;

let WebIM = require("utils/WebIM")["default"];

let conn = {
	closed: false,
	curOpenOpt: {},
	open(opt) {
		this.curOpenOpt = opt;
		WebIM.conn.open(opt);
		this.closed = false;
	},
	reopen() {
		if (this.closed) {
			//this.open(this.curOpenOpt);
			WebIM.conn.open(this.curOpenOpt);
			this.closed = false;
		}
	}
};

Vue.prototype.$im = WebIM;
Vue.prototype.$conn = conn;

Vue.prototype.$helper = helper;
Vue.config.productionTip = false

App.mpType = 'app'
Vue.component('eLoading', eLoading);
Vue.component('uni-popup', uniPopup);
Vue.component('uni-popup-message', uniPopupMessage);
Vue.component('uni-popup-dialog', uniPopupDialog);
Vue.component('uni-load-more', uniLoadMore);
const app = new Vue({
    ...App
})
app.$mount()
